//
//  NYGradeViewController.m
//  NiuWaJiaoYu
//
//  Created by MinLison on 2018/1/9.
//  Copyright © 2018年 niuwaketang. All rights reserved.
//

#import "NYGradeViewController.h"

@interface NYGradeViewController ()

@end

@implementation NYGradeViewController

#pragma mark - Life Cycle Methods

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initUI];
}
#pragma mark - Intial Methods
- (void)initUI {
    
    self.tableView.backgroundColor = UIColorMakeWithHex(@"#F5F5F5");
}
- (void)initTableView {
    [super initTableView];
    
}
- (void)configNimbus {
    [super configNimbus];
    self.tableViewModel.delegate = self;

}
#pragma mark - Network Methods

#pragma mark - Target Methods

#pragma mark - Public Methods

#pragma mark - Private Method

#pragma mark - External Delegate
- (void)setItemMutaArray:(NSMutableArray *)itemMutaArray {
    
    _itemMutaArray = itemMutaArray;
    
    [self configNimbus];
    [self.tableViewModel removeAll];
    [self.tableViewModel addObjectsFromArray:_itemMutaArray];
    [self.tableView reloadData];
    
    [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:(UITableViewScrollPositionNone)];
}
#pragma mark - UITableViewDelegate,UITableViewDataSource
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (self.selectedBlock)
    {
        self.selectedBlock([self.tableViewModel objectAtIndexPath:indexPath]);
    }
}

#pragma mark - Setter Getter Methods

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
